function  generate_label(field)
{
		var label = toFirstUpper(field)
					.replace(/Dist([A-Z])/g, "DistanceTo$1")
					.replace(/([A-Z])/g, " $1")
					.replace(/No /g, "Number ");
		return label;
		
}

function toFirstUpper(fieldname) 
{
		return fieldname.replace(""+fieldname.charAt(0),
				""+fieldname.charAt(0).toUpperCase());
}
	
function changeLabels()
{
	var labels=document.getElementsByTagName("label");
	var i=0;
	while (i < labels.length)
		{
			var label = labels[i++];
			label.innerHTML=generate_label(label.innerHTML);
		}
}